package com.ibm.risk.irmp.base.dict.dao;

import com.ibm.risk.irmp.base.dict.entity.BaseDictGroup;
import com.ibm.risk.irmp.base.dict.entity.BaseDictLabel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface PBaseDictGroupRepository extends JpaRepository<BaseDictGroup, String> {
    void deleteByCode(String code);

    @Query("from BaseDictLabel l where l.groupCode = ?1 and l.lang = ?2")
    List<BaseDictLabel> getGroupLangLabels(String groupCode, String lang);
}
